#!/bin/ash

case "$ACTION" in
    add)
        for i in $(ls /dev/ | grep 'sd[a-z][1-9]')
        do
            mkdir -p /mnt/$i
            mount -o rw /dev/$i /mnt/$i
        done
        ;;
    remove)
        MOUNT=`mount | grep -o '/mnt/sd[a-z][1-9]'`
        for i in $MOUNT
        do
            umount $i
            if [ $? -eq 0 ]
            then
                rm -r $i
            fi
        done
        ;;
esac
